<template>
	<view class="links">
		<u-row gutter="16" v-if="linksList[0]">
			<u-col span="3" v-for="v in linksList" :key="v.id" @click="Open(v)">
				<view class="image-title br10">
          <div class="image">
            <image :src="v.logo" mode=""></image>
          </div>
          <view class="title t1">
            {{v.title}}
          </view>
        </view>
			</u-col>
		</u-row>
    <view class="no-data" v-else>
        <image src="/static/inbetweening/no-data.png" mode="widthFix"></image>
        <view class="title"> 暂无内容 </view>
      </view>
    </view>
	</view>
</template>
<script>
export default{
  data(){
    return{
      linksList:[]
    }
  },
  created() {
    this.getLinksList()
  },
  methods:{
    getLinksList() {
      let data = {
        status: 1,
      }
      this.$store.dispatch("links/list", data).then(res => {
        this.linksList = res.data
      })
    },
    Open(v){
 uni.navigateToMiniProgram({
   appId: v.appId,
   path: v.page,
   success(res) {
     // 打开成功
   }
 })
    }
  }
}
</script>
<style scoped lang="scss">
  .links{
    margin: 20upx;
    .image-title{
      background-color: #fff;
      padding: 20upx 0;
      margin-bottom: 20upx;
      .image{
  width: 100upx;
  height: 100upx;
  margin: 0 auto;
  image{
    width: 100%;
    height: 100%;
  }
}
.title{
  font-size:24upx;
  text-align: center;
}
    }

  }

</style>
